var loginService = function () {
	var getData = function (callback) {
            return dataSrv.postJsonLogin('api/oauth/token',
                                       {
                                         grant_type:"password",
                                       username: callback.username,
                                       password: callback.password
                                         
                                       });
		},
    refreshToken = function(callback){
        return dataSrv.postJsonLogin('api/oauth/token',
                                     {
                                     grant_type:"refresh_token",
                                     refresh_token: strRefreshToken
                                     });
    },
    logout = function (callback) {
        return dataSrv.getJson('api/v1/mobile/logout',
                                     {
//                                     access_token: strAccessToken
                               
                                     });
    },
	register = function (callback) {
        return dataSrv.getJson('api/v1/mobile/open/free-registration',
                                   {
                                   first_name: callback.firstName,
                                   last_name: callback.lastName,
                                   username: callback.email,
                                   password: callback.password,
                                   password_check: callback.passwordCheck,
                                   device_id: strDeviceId,
                                   os_language: systemLanguage,
                                   app_version: appVersionPrefix+appVersion
                                   });

	};

	return {
		getData: getData,
        refreshToken: refreshToken,
        register: register,
        logout: logout
	};
}();
